<?php defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

/* JoomLeague League Management and Prediction Game for Joomla!
 * Copyright (C) 2007  Robert Moss
 *  
 * Homepage: http://www.joomleague.de
 * Support: htt://www.joomleague.de/forum/
 * 
 * This file is part of JoomLeague.
 *  
 * JoomLeague is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Please note that the GPL states that any headers in files and
 * Copyright notices as well as credits in headers, source files
 * and output (screens, prints, etc.) can not be removed.
 * You can extend them with your own credits, though...
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * The "GNU General Public License" (GPL) is available at
 * http://www.gnu.org/copyleft/gpl.html.
*/ 

require_once( $mainframe->getPath( 'toolbar_default' ) );

switch ($act) {
  
  case "showTables":
  case "updates":
  case "frontend":
  case "LMOimport":
  case "import":
  case "showRanking":
    mosMenuBar::startTable();
    mosMenuBar::back("back");
    mosMenuBar::endTable();
  break;
  
  case "tips":
    
    switch($task){

      default:
        mosMenuBar::startTable();
        echo <<<EOL
		    <td>
		    <a class="toolbar" href="javascript:if (document.adminForm.project_id.value == 0){ alert('Please choose a project!'); } else { if (confirm('This will send an email reminder to all users with reminder option enabled, are you sure?')) { submitbutton('send');}}">
					    <img src="$mosConfig_live_site/administrator/images/publish_f2.png"  alt="Send Mail" align="middle" border="0" /><br />Send Mail</a>
			        </td>
EOL;
        //mosMenuBar::custom('send','publish.png','publish_f2.png','Send Mail',false);
        mosMenuBar::custom("approve",'apply_f2.png','apply_f2.png','Approve');
        mosMenuBar::custom("reject",'apply.png','apply.png','Reject');
        mosMenuBar::deleteList("The selected users and all of there tips will be deleted permanently! If you want to suspend a user please use the reject option, this will keep all tips of the user!","remove");
        mosMenuBar::endTable();
      break;
    }
  break;
  
  
  case "matches":
    
    switch($task){
      
      //case "new":
      case "edit":
		    mosMenuBar::startTable();
		    mosMenuBar::save("save");
		    mosMenuBar::cancel("cancel");
		    mosMenuBar::endTable();
	    break;
      
      default:
        mosMenuBar::startTable();
        mosMenuBar::publishList();
        mosMenuBar::unpublishList();
        mosMenuBar::divider();
		    //mosMenuBar::addNew("new");
		    mosMenuBar::editList("edit");
		    mosMenuBar::deleteList("","remove");
		    mosMenuBar::spacer();
		    mosMenuBar::endTable();
      break;
      
    }
  break;

  case "rounds":
        
    switch($task){
      
      default:
		    mosMenuBar::startTable();
		    mosMenuBar::addNew("new");
		    mosMenuBar::editList("edit");
        mosMenuBar::custom( 'return', 'copy.png', 'copy_f2.png', 'Return leg' );
		    mosMenuBar::deleteList("","remove");
		    mosMenuBar::spacer();
		    mosMenuBar::endTable();
      break;
      
      case "new":
		    mosMenuBar::startTable();
		    mosMenuBar::save("save");
		    mosMenuBar::cancel("cancel");
		    mosMenuBar::endTable();
	    break;
      
      case "tab1":
      case "tab2":
      case "matrix":
      case "unpublishmatches":
      case "publishmatches":
        mosMenuBar::startTable();
        echo '<td><a class="toolbar" href="javascript:document.matrixForm.submit()">
					    <img src="'.$mosConfig_live_site.'/administrator/images/new_f2.png"  alt="New Match" name="document.matrixForm()" title="New Match" align="middle" border="0" />					<br />New Match</a>
			        </td>';
        mosMenuBar::divider();
        mosMenuBar::publishList("publishmatches");
        mosMenuBar::unpublishList("unpublishmatches");
        mosMenuBar::divider();
        mosMenuBar::custom("savematches",'save.png','save_f2.png','Save');   
        mosMenuBar::deleteList("","deletematches");
        mosMenuBar::divider();
        mosMenuBar::custom("setmatchesnull",'edit.png','edit_f2.png','setNull');  
        mosMenuBar::endTable();
      break;
      
      case "edit":
		    mosMenuBar::startTable();
		    mosMenuBar::save("save");
		    mosMenuBar::cancel("cancel");
		    mosMenuBar::endTable();
	    break; 
    }
    
  break;

  case "assign":
        
    switch($task){
      
      case 'edit':
        mosMenuBar::startTable();
		    mosMenuBar::save("saveOne");
		    mosMenuBar::endTable();
      break;
      
      default:
		    mosMenuBar::startTable();
		    mosMenuBar::save("saveAll");
		    mosMenuBar::endTable();
      break;
      
    }
    break;
  
  case "playertool":
        
    switch($task){
      
      default:
		    mosMenuBar::startTable();
		    mosMenuBar::save("saveShort");
        mosMenuBar::custom("assign",'edit.png','edit_f2.png','Assign',false);
        mosMenuBar::divider();
		    mosMenuBar::editList("edit");
		    //mosMenuBar::deleteList("","remove");
		    mosMenuBar::spacer();
		    mosMenuBar::endTable();
      break;
      
      case 'assign':
        mosMenuBar::startTable();
		    mosMenuBar::save("saveAll");
		    mosMenuBar::cancel("cancel");
		    mosMenuBar::endTable();
      break;
      
      case "edit":
		    mosMenuBar::startTable();
		    mosMenuBar::save("saveOne");
		    mosMenuBar::cancel("cancel");
		    mosMenuBar::endTable();
	    break; 
    }
    break;
  
  case "positionEventType":
        
    switch($task){
      
      default:
		    mosMenuBar::startTable();
		    mosMenuBar::save("saveShort");
        mosMenuBar::divider();
		    mosMenuBar::editList("edit");
		    mosMenuBar::deleteList("","remove");
		    mosMenuBar::addNew("add","add");
		    mosMenuBar::spacer();
		    mosMenuBar::endTable();
      break;
      
      case "edit":
      case "add" :
		    mosMenuBar::startTable();
		    mosMenuBar::save("save");
		    mosMenuBar::cancel("cancel");
		    mosMenuBar::endTable();
	    break; 
    }
    break;
    
  default:
        
    switch($task){
      
      case "copy":
		    mosMenuBar::startTable();
		    mosMenuBar::save("copysave");
		    mosMenuBar::cancel("cancel");
		    mosMenuBar::endTable();
	    break;
      
      case "new":
		    mosMenuBar::startTable();
		    mosMenuBar::save("save");
		    mosMenuBar::cancel("cancel");
		    mosMenuBar::endTable();
	    break;
      
      case "edit":
		    mosMenuBar::startTable();
		    mosMenuBar::apply("apply");		    
		    mosMenuBar::save("save");
		    mosMenuBar::cancel("cancel");
		    mosMenuBar::endTable();
	    break; 
      
      default:
		    mosMenuBar::startTable();
        mosMenuBar::publishList();
        mosMenuBar::unpublishList();
        mosMenuBar::divider();
        mosMenuBar::custom( 'copy', 'copy.png', 'copy_f2.png', 'Copy' );
		    mosMenuBar::deleteList("","remove");
		    mosMenuBar::editList("edit");
		    mosMenuBar::addNew("new");
		    mosMenuBar::spacer();
		    mosMenuBar::endTable();
		  break;
    }
    
  break;
  
  case "teamtool":	
    
    switch($task){	
      
      default:
		    mosMenuBar::startTable();
        mosMenuBar::custom("setactual",'edit.png','edit_f2.png','Use');
        mosMenuBar::divider();
        mosMenuBar::custom("assign",'edit.png','edit_f2.png','Assign',false);
            mosMenuBar::divider();
            mosMenuBar::custom( 'copy', 'copy.png', 'copy_f2.png', 'Copy' );
        mosMenuBar::divider();
		    mosMenuBar::editList("edit");
		    mosMenuBar::spacer();
		    mosMenuBar::endTable();
      break;
      
      case "copy":
		    mosMenuBar::startTable();
//            mosMenuBar::custom("copysave",'save.png','save_f2.png','Save');   
		    mosMenuBar::save("copysave");
		    mosMenuBar::cancel("cancel");
		    mosMenuBar::endTable();
	    break;
      
      case "assign":
		    mosMenuBar::startTable();
		    mosMenuBar::save("saveAll");
		    mosMenuBar::cancel("cancel");
		    mosMenuBar::endTable();
	    break;
      
      case "edit":
		    mosMenuBar::startTable();
		    mosMenuBar::save("saveOne");
		    mosMenuBar::cancel("cancel");
		    mosMenuBar::endTable();
	    break;
    
    }
  
  break;
  case "players":
  switch($task){
  	default:
	  	mosMenuBar::startTable();
	  	mosMenuBar::save("saveShort");
	  	mosMenuBar::addNew("new");
			mosMenuBar::editList("edit");
			mosMenuBar::deleteList("","remove");
			mosMenuBar::spacer();
			mosMenuBar::endTable();
		break;
		case "new":
		    mosMenuBar::startTable();
		    mosMenuBar::save("save");
		    mosMenuBar::cancel("cancel");
		    mosMenuBar::endTable();
	    break;
      
      case "edit":
		    mosMenuBar::startTable();
		    mosMenuBar::save("save");
		    mosMenuBar::cancel("cancel");
		    mosMenuBar::endTable();
	    break; 
    }
	 break;
  case "clubs":
  case "leagues":
  case "seasons":
  case "eventtypes":
  case "positions":
  case "teams":
  case "playgrounds":
  case "referees":
  case "matchevents":
    
    switch($task){
      
      default:
		    mosMenuBar::startTable();
		    mosMenuBar::addNew("new");
		    mosMenuBar::editList("edit");
		    mosMenuBar::deleteList("","remove");
		    mosMenuBar::spacer();
		    mosMenuBar::endTable();
      break;
      
      case "new":
		    mosMenuBar::startTable();
		    mosMenuBar::save("save");
		    mosMenuBar::cancel("cancel");
		    mosMenuBar::endTable();
	    break;
      
      case "edit":
		    mosMenuBar::startTable();
		    mosMenuBar::save("save");
		    mosMenuBar::cancel("cancel");
		    mosMenuBar::endTable();
	    break; 
    }
    
  break;
  case "countries":
  
    switch($task){
	   
      case "new":
      case "edit":
				mosMenuBar::startTable();
		    mosMenuBar::save("save");
		    mosMenuBar::cancel("cancel");
		    mosMenuBar::endTable();
	   break;
	   
  	 default:
	     mosMenuBar::startTable();
	     mosMenuBar::publishList();
       mosMenuBar::unpublishList();
	     mosMenuBar::editList("edit");
	     mosMenuBar::addNew("new");
	     mosMenuBar::endTable();
	   break;
    }
  
  break;
  case "template_config":
    
    switch($task){
      
      default:
		    mosMenuBar::startTable();
		    echo <<<EOL
		    <td>
		    <a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('Please make a selection from the list to reset'); } else { if (confirm('This will reset the template configuration to the default values, are you really sure?')) { submitbutton('reset');}}">
					    <img src="$mosConfig_live_site/administrator/images/restore_f2.png"  alt="Reset Template(s)" align="middle" border="0" /><br />Reset</a>
			        </td>
EOL;
 
		    mosMenuBar::editList("edit");
		    mosMenuBar::back("back");
		    mosMenuBar::endTable();
      break;
      
      case "edit":
		    mosMenuBar::startTable();
		    mosMenuBar::apply("apply");		    
		    mosMenuBar::save("save");
		    mosMenuBar::cancel("cancel");
		    mosMenuBar::endTable();
	    break; 
    }
    break;
}

?>
